Optimal. Leaf size=242 \[ -\frac {a (4 a+b) \log (1-\sin (c+d x))}{8 (a+b)^4 d}-\frac {a (4 a-b) \log (1+\sin (c+d x))}{8 (a-b)^4 d}+\frac {a^4 \left (a^2+5 b^2\right ) \log (a+b \sin (c+d x))}{\left (a^2-b^2\right )^4 d}-\frac {a^5}{\left (a^2-b^2\right )^3 d (a+b \sin (c+d x))}+\frac {\sec ^4(c+d x) \left (a^2+b^2-2 a b \sin (c+d x)\right )}{4 \left (a^2-b^2\right )^2 d}-\frac {\sec ^2(c+d x) \left (2 \left (2 a^4+3 a^2 b^2-b^4\right )-a b \left (9 a^2-b^2\right ) \sin (c+d x)\right )}{4 \left (a^2-b^2\right )^3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.53, antiderivative size = 242, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2800, 1661,
1643} \begin {gather*} \frac {\sec ^4(c+d x) \left (a^2-2 a b \sin (c+d x)+b^2\right )}{4 d \left (a^2-b^2\right )^2}-\frac {a^5}{d \left (a^2-b^2\right )^3 (a+b \sin (c+d x))}+\frac {a^4 \left (a^2+5 b^2\right ) \log (a+b \sin (c+d x))}{d \left (a^2-b^2\right )^4}-\frac {\sec ^2(c+d x) \left (2 \left (2 a^4+3 a^2 b^2-b^4\right )-a b \left (9 a^2-b^2\right ) \sin (c+d x)\right )}{4 d \left (a^2-b^2\right )^3}-\frac {a (4 a+b) \log (1-\sin (c+d x))}{8 d (a+b)^4}-\frac {a (4 a-b) \log (\sin (c+d x)+1)}{8 d (a-b)^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 1643
Rule 1661
Rule 2800
Rubi steps
\begin {align*} \int \frac {\tan ^5(c+d x)}{(a+b \sin (c+d x))^2} \, dx &=\frac {\text {Subst}\left (\int \frac {x^5}{(a+x)^2 \left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\sec ^4(c+d x) \left (a^2+b^2-2 a b \sin (c+d x)\right )}{4 \left (a^2-b^2\right )^2 d}+\frac {\text {Subst}\left (\int \frac {\frac {2 a^3 b^6}{\left (a^2-b^2\right )^2}-\frac {4 a^4 b^4 x}{\left (a^2-b^2\right )^2}-\frac {6 a b^6 x^2}{\left (a^2-b^2\right )^2}-4 b^2 x^3}{(a+x)^2 \left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{4 b^2 d}\\ &=\frac {\sec ^4(c+d x) \left (a^2+b^2-2 a b \sin (c+d x)\right )}{4 \left (a^2-b^2\right )^2 d}-\frac {\sec ^2(c+d x) \left (2 \left (2 a^4+3 a^2 b^2-b^4\right )-a b \left (9 a^2-b^2\right ) \sin (c+d x)\right )}{4 \left (a^2-b^2\right )^3 d}+\frac {\text {Subst}\left (\int \frac {-\frac {2 a^3 b^6 \left (7 a^2+b^2\right )}{\left (a^2-b^2\right )^3}+\frac {4 a^2 b^4 \left (2 a^2+b^2\right ) x}{\left (a^2-b^2\right )^2}+\frac {2 a b^6 \left (9 a^2-b^2\right ) x^2}{\left (a^2-b^2\right )^3}}{(a+x)^2 \left (b^2-x^2\right )} \, dx,x,b \sin (c+d x)\right )}{8 b^4 d}\\ &=\frac {\sec ^4(c+d x) \left (a^2+b^2-2 a b \sin (c+d x)\right )}{4 \left (a^2-b^2\right )^2 d}-\frac {\sec ^2(c+d x) \left (2 \left (2 a^4+3 a^2 b^2-b^4\right )-a b \left (9 a^2-b^2\right ) \sin (c+d x)\right )}{4 \left (a^2-b^2\right )^3 d}+\frac {\text {Subst}\left (\int \left (\frac {a b^4 (4 a+b)}{(a+b)^4 (b-x)}+\frac {8 a^5 b^4}{(a-b)^3 (a+b)^3 (a+x)^2}+\frac {8 a^4 b^4 \left (a^2+5 b^2\right )}{(a-b)^4 (a+b)^4 (a+x)}-\frac {a (4 a-b) b^4}{(a-b)^4 (b+x)}\right ) \, dx,x,b \sin (c+d x)\right )}{8 b^4 d}\\ &=-\frac {a (4 a+b) \log (1-\sin (c+d x))}{8 (a+b)^4 d}-\frac {a (4 a-b) \log (1+\sin (c+d x))}{8 (a-b)^4 d}+\frac {a^4 \left (a^2+5 b^2\right ) \log (a+b \sin (c+d x))}{\left (a^2-b^2\right )^4 d}-\frac {a^5}{\left (a^2-b^2\right )^3 d (a+b \sin (c+d x))}+\frac {\sec ^4(c+d x) \left (a^2+b^2-2 a b \sin (c+d x)\right )}{4 \left (a^2-b^2\right )^2 d}-\frac {\sec ^2(c+d x) \left (2 \left (2 a^4+3 a^2 b^2-b^4\right )-a b \left (9 a^2-b^2\right ) \sin (c+d x)\right )}{4 \left (a^2-b^2\right )^3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 4.25, size = 204, normalized size = 0.84 \begin {gather*} \frac {-\frac {2 a (4 a+b) \log (1-\sin (c+d x))}{(a+b)^4}-\frac {2 a (4 a-b) \log (1+\sin (c+d x))}{(a-b)^4}+\frac {16 a^4 \left (a^2+5 b^2\right ) \log (a+b \sin (c+d x))}{\left (a^2-b^2\right )^4}+\frac {1}{(a+b)^2 (-1+\sin (c+d x))^2}+\frac {7 a+3 b}{(a+b)^3 (-1+\sin (c+d x))}+\frac {1}{(a-b)^2 (1+\sin (c+d x))^2}+\frac {-7 a+3 b}{(a-b)^3 (1+\sin (c+d x))}-\frac {16 a^5}{\left (a^2-b^2\right )^3 (a+b \sin (c+d x))}}{16 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.59, size = 205, normalized size = 0.85 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 505 vs.
\(2 (235) = 470\).
time = 0.40, size = 505, normalized size = 2.09 \begin {gather*} \frac {\frac {8 \, {\left (a^{6} + 5 \, a^{4} b^{2}\right )} \log \left (b \sin \left (d x + c\right ) + a\right )}{a^{8} - 4 \, a^{6} b^{2} + 6 \, a^{4} b^{4} - 4 \, a^{2} b^{6} + b^{8}} - \frac {{\left (4 \, a^{2} - a b\right )} \log \left (\sin \left (d x + c\right ) + 1\right )}{a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}} - \frac {{\left (4 \, a^{2} + a b\right )} \log \left (\sin \left (d x + c\right ) - 1\right )}{a^{4} + 4 \, a^{3} b + 6 \, a^{2} b^{2} + 4 \, a b^{3} + b^{4}} - \frac {2 \, {\left (7 \, a^{5} + 6 \, a^{3} b^{2} - a b^{4} + {\left (4 \, a^{5} + 9 \, a^{3} b^{2} - a b^{4}\right )} \sin \left (d x + c\right )^{4} + {\left (5 \, a^{4} b - 7 \, a^{2} b^{3} + 2 \, b^{5}\right )} \sin \left (d x + c\right )^{3} - {\left (12 \, a^{5} + 13 \, a^{3} b^{2} - a b^{4}\right )} \sin \left (d x + c\right )^{2} - {\left (4 \, a^{4} b - 5 \, a^{2} b^{3} + b^{5}\right )} \sin \left (d x + c\right )\right )}}{a^{7} - 3 \, a^{5} b^{2} + 3 \, a^{3} b^{4} - a b^{6} + {\left (a^{6} b - 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} - b^{7}\right )} \sin \left (d x + c\right )^{5} + {\left (a^{7} - 3 \, a^{5} b^{2} + 3 \, a^{3} b^{4} - a b^{6}\right )} \sin \left (d x + c\right )^{4} - 2 \, {\left (a^{6} b - 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} - b^{7}\right )} \sin \left (d x + c\right )^{3} - 2 \, {\left (a^{7} - 3 \, a^{5} b^{2} + 3 \, a^{3} b^{4} - a b^{6}\right )} \sin \left (d x + c\right )^{2} + {\left (a^{6} b - 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} - b^{7}\right )} \sin \left (d x + c\right )}}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 555 vs.
\(2 (235) = 470\).
time = 0.55, size = 555, normalized size = 2.29 \begin {gather*} \frac {2 \, a^{7} - 6 \, a^{5} b^{2} + 6 \, a^{3} b^{4} - 2 \, a b^{6} - 2 \, {\left (4 \, a^{7} + 5 \, a^{5} b^{2} - 10 \, a^{3} b^{4} + a b^{6}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (4 \, a^{7} - 9 \, a^{5} b^{2} + 6 \, a^{3} b^{4} - a b^{6}\right )} \cos \left (d x + c\right )^{2} + 8 \, {\left ({\left (a^{6} b + 5 \, a^{4} b^{3}\right )} \cos \left (d x + c\right )^{4} \sin \left (d x + c\right ) + {\left (a^{7} + 5 \, a^{5} b^{2}\right )} \cos \left (d x + c\right )^{4}\right )} \log \left (b \sin \left (d x + c\right ) + a\right ) - {\left ({\left (4 \, a^{6} b + 15 \, a^{5} b^{2} + 20 \, a^{4} b^{3} + 10 \, a^{3} b^{4} - a b^{6}\right )} \cos \left (d x + c\right )^{4} \sin \left (d x + c\right ) + {\left (4 \, a^{7} + 15 \, a^{6} b + 20 \, a^{5} b^{2} + 10 \, a^{4} b^{3} - a^{2} b^{5}\right )} \cos \left (d x + c\right )^{4}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left ({\left (4 \, a^{6} b - 15 \, a^{5} b^{2} + 20 \, a^{4} b^{3} - 10 \, a^{3} b^{4} + a b^{6}\right )} \cos \left (d x + c\right )^{4} \sin \left (d x + c\right ) + {\left (4 \, a^{7} - 15 \, a^{6} b + 20 \, a^{5} b^{2} - 10 \, a^{4} b^{3} + a^{2} b^{5}\right )} \cos \left (d x + c\right )^{4}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (a^{6} b - 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} - b^{7} - {\left (5 \, a^{6} b - 12 \, a^{4} b^{3} + 9 \, a^{2} b^{5} - 2 \, b^{7}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{8 \, {\left ({\left (a^{8} b - 4 \, a^{6} b^{3} + 6 \, a^{4} b^{5} - 4 \, a^{2} b^{7} + b^{9}\right )} d \cos \left (d x + c\right )^{4} \sin \left (d x + c\right ) + {\left (a^{9} - 4 \, a^{7} b^{2} + 6 \, a^{5} b^{4} - 4 \, a^{3} b^{6} + a b^{8}\right )} d \cos \left (d x + c\right )^{4}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tan ^{5}{\left (c + d x \right )}}{\left (a + b \sin {\left (c + d x \right )}\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 494 vs.
\(2 (235) = 470\).
time = 7.52, size = 494, normalized size = 2.04 \begin {gather*} \frac {\frac {8 \, {\left (a^{6} b + 5 \, a^{4} b^{3}\right )} \log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a^{8} b - 4 \, a^{6} b^{3} + 6 \, a^{4} b^{5} - 4 \, a^{2} b^{7} + b^{9}} - \frac {{\left (4 \, a^{2} - a b\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right )}{a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}} - \frac {{\left (4 \, a^{2} + a b\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{a^{4} + 4 \, a^{3} b + 6 \, a^{2} b^{2} + 4 \, a b^{3} + b^{4}} - \frac {8 \, {\left (a^{6} b \sin \left (d x + c\right ) + 5 \, a^{4} b^{3} \sin \left (d x + c\right ) + 2 \, a^{7} + 4 \, a^{5} b^{2}\right )}}{{\left (a^{8} - 4 \, a^{6} b^{2} + 6 \, a^{4} b^{4} - 4 \, a^{2} b^{6} + b^{8}\right )} {\left (b \sin \left (d x + c\right ) + a\right )}} + \frac {2 \, {\left (3 \, a^{6} \sin \left (d x + c\right )^{4} + 15 \, a^{4} b^{2} \sin \left (d x + c\right )^{4} - 9 \, a^{5} b \sin \left (d x + c\right )^{3} + 10 \, a^{3} b^{3} \sin \left (d x + c\right )^{3} - a b^{5} \sin \left (d x + c\right )^{3} - 2 \, a^{6} \sin \left (d x + c\right )^{2} - 28 \, a^{4} b^{2} \sin \left (d x + c\right )^{2} - 8 \, a^{2} b^{4} \sin \left (d x + c\right )^{2} + 2 \, b^{6} \sin \left (d x + c\right )^{2} + 7 \, a^{5} b \sin \left (d x + c\right ) - 6 \, a^{3} b^{3} \sin \left (d x + c\right ) - a b^{5} \sin \left (d x + c\right ) + 12 \, a^{4} b^{2} + 7 \, a^{2} b^{4} - b^{6}\right )}}{{\left (a^{8} - 4 \, a^{6} b^{2} + 6 \, a^{4} b^{4} - 4 \, a^{2} b^{6} + b^{8}\right )} {\left (\sin \left (d x + c\right )^{2} - 1\right )}^{2}}}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 7.78, size = 755, normalized size = 3.12 \begin {gather*} \frac {\ln \left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )\,\left (a^6+5\,a^4\,b^2\right )}{d\,\left (a^8-4\,a^6\,b^2+6\,a^4\,b^4-4\,a^2\,b^6+b^8\right )}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )\,\left (\frac {1}{{\left (a+b\right )}^2}-\frac {7\,b}{4\,{\left (a+b\right )}^3}+\frac {3\,b^2}{4\,{\left (a+b\right )}^4}\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )\,\left (\frac {3\,b^2}{4\,{\left (a-b\right )}^4}+\frac {7\,b}{4\,{\left (a-b\right )}^3}+\frac {1}{{\left (a-b\right )}^2}\right )}{d}-\frac {\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^3+a\,b^2\right )}{a^4-2\,a^2\,b^2+b^4}+\frac {3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (a\,b^2-2\,a^3\right )}{a^4-2\,a^2\,b^2+b^4}+\frac {3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (a\,b^2-2\,a^3\right )}{a^4-2\,a^2\,b^2+b^4}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (2\,a^3+a\,b^2\right )}{a^4-2\,a^2\,b^2+b^4}-\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,\left (11\,a^4+a^2\,b^2\right )}{2\,\left (a^6-3\,a^4\,b^2+3\,a^2\,b^4-b^6\right )}+\frac {8\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (2\,a^4+a^2\,b^2\right )}{\left (a^2-b^2\right )\,\left (a^4-2\,a^2\,b^2+b^4\right )}+\frac {8\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (2\,a^4+a^2\,b^2\right )}{\left (a^2-b^2\right )\,\left (a^4-2\,a^2\,b^2+b^4\right )}-\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (13\,a^4+31\,a^2\,b^2-8\,b^4\right )}{\left (a^2-b^2\right )\,\left (a^4-2\,a^2\,b^2+b^4\right )}-\frac {b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (11\,a^4+a^2\,b^2\right )}{2\,\left (a^2-b^2\right )\,\left (a^4-2\,a^2\,b^2+b^4\right )}}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9-3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-8\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+12\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-8\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________